package com.yingxin.yxerp.module.sys.entity.builder;

import cn.hutool.core.bean.BeanUtil;
import com.yingxin.yx.framework.commons.id.IdHelper;
import com.yingxin.yxerp.module.sys.entity.BankAccount;
import com.yingxin.yxerp.module.sys.vo.req.BankAccountCreateVo;
import org.apache.commons.lang3.StringUtils;

public class BankAccountBuilder {

    public static BankAccount build(BankAccountCreateVo vo) {
        BankAccount account = new BankAccount();
        BeanUtil.copyProperties(vo, account);
        if (StringUtils.isEmpty(account.getId())) {
            account.setId(IdHelper.snowflakeId());
        }
        return account;
    }

}
